<script setup lang="ts">
import * as storage from '@/util/storage'
import * as Vue from 'vue'
import {onLaunch, onShow, onHide} from "@dcloudio/uni-app";

onLaunch(() => {
  uni.getSystemInfo({
    success: (e) => {
      // #ifndef MP
      if (e.platform == 'android') {
        storage.setCustomBarHeight(e.statusBarHeight + 50)
      } else {
        storage.setCustomBarHeight(e.statusBarHeight + 45)
      }
      ;
      // #endif
      // #ifdef MP-WEIXIN || MP-QQ
      const capsule = uni.getMenuButtonBoundingClientRect();
      if (capsule) {
        storage.setCustomBarHeight(capsule.bottom + capsule.top - e.statusBarHeight)
      } else {
        storage.setCustomBarHeight(e.statusBarHeight + 50)
      }
      // #endif
      // #ifdef MP-ALIPAY
      storage.setCustomBarHeight(e.statusBarHeight + e.titleBarHeight)
      // #endif

      storage.setStatusBarHeight(e.statusBarHeight)
      storage.setScreenWidth(e.screenWidth)
      storage.setScreenHeight(e.screenHeight)
    }
  })
});
onShow(() => {
  console.log("App Show");
});
onHide(() => {
  console.log("App Hide");
});
</script>

<style>
@import url('./assets/index.css');
@import url('./assets/icon/iconfont.css');
/* #ifndef APP-PLUS-NVUE */
@import './components/colorui/main.css';
@import './components/colorui/icon.css';
/* #endif */

@font-face {
  font-family: "PingFang";
  src: url('./assets/PingFang.ttf');
}

.global-font{
 font-family:"PingFang";
 /* font-size:16px;
  color:red */
}

/* @import 'components/font-awesome.min.css' */

/* 解决头条小程序组件内引入字体不生效的问题 */
/* #ifdef MP-TOUTIAO */
/* @font-face {
  font-family: uniicons;
  src: url('./assets/uni.ttf');
} */

/* #endif */
</style>
